<template>
  <div id="myEditor">

  </div>
</template>

<script setup>
import E from 'wangeditor'
import { onMounted } from 'vue'
const emit = defineEmits(['getContent'])
const props = defineProps({
  content: String
})
onMounted(() => {
  const editor = new E('#myEditor')
  editor.create()
  props.content&&editor.txt.html(props.content)
  editor.config.onchange = function (newHtml) {
    emit('getContent', newHtml)
  };
})

</script>

<style scoped></style>